/**
 * Copyright (C) 2018 Jeebiz (http://jeebiz.net).
 * All Rights Reserved.
 */
package io.hiwepy.admin.authz.rbac0.dao;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import io.hiwepy.admin.authz.feature.dao.entities.FeatureEntity;
import io.hiwepy.admin.authz.feature.dao.entities.FeatureOptEntity;
import io.hiwepy.boot.api.dao.BaseMapper;
 
@Mapper
public interface RoleFeatureMapper extends BaseMapper<FeatureEntity>{

	/**
	 * 查询指定角色id拥有的功能菜单
	 * @param roleId
	 * @return
	 */
	public List<FeatureEntity> getFeatures(@Param(value = "roleId") String roleId);

	/**
	 * 查找功能操作并标记指定角色拥有权限的功能操作选中状态
	 * @param roleId
	 * @return
	 */
	public List<FeatureOptEntity> getFeatureOpts(@Param(value = "roleId") String roleId);

	/**
	 * 查询用户指定功能菜单下已经授权的功能菜单
	 * @return
	 */
	public List<FeatureEntity> getChildFeatures(@Param(value = "roleId") String roleId, @Param("servId") String servId);

	/**
	 * 查找功能操作并标记指定角色拥有权限的功能操作选中状态
	 * @param roleId
	 * @return
	 */
	public List<FeatureOptEntity> getChildFeatureOpts(@Param(value = "roleId") String roleId);

}
